<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:uic="clr-namespace:UI.Control"
  xmlns:igDP="http://infragistics.com/DataPresenter"
  xmlns:igWindows="http://infragistics.com/Windows">

	<Style TargetType="{x:Type igDP:DataRecordPresenter}">
		<Setter Property="HeaderAreaBackground" Value="{x:Null}"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type igDP:DataRecordPresenter}">
					<igWindows:CardPanel x:Name="baseGrid">
						<Grid Margin="0">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="Auto" />
								<ColumnDefinition Width="Auto" />
								<ColumnDefinition Width="*" />
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto" />
								<RowDefinition Height="Auto" />
								<RowDefinition Height="Auto" />
							</Grid.RowDefinitions>

							<!-- Expansion Checkbox -->
							<igWindows:ExpansionIndicator
															 x:Name="ExpansionIndicator"
															 Grid.Row="1"
															 Grid.Column="0"
															 Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ExpansionIndicatorVisibility}"
															 IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsExpanded, Mode=TwoWay}"
									/>
							<!-- Header Background -->
							<!-- Added 8/2/2006 GH -->
							<igWindows:CardPanel x:Name="SpacerFill" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Visibility="Visible">
								<!--Rectangle x:Name="fill" Visibility="Hidden"  Margin="0,0,0,0" Fill="{TemplateBinding HeaderAreaBackground}" /-->
								<!--Rectangle x:Name="lightLine" Visibility="Hidden" Fill="#3FFFFFFF" VerticalAlignment="Top" Margin="0,1,0,0" Width="Auto" Height="1"/>
									<Rectangle x:Name="darkLine" Visibility="Hidden" Fill="#66000000" VerticalAlignment="Top" Margin="0,0,0,0" Width="Auto" Height="1"/-->
							</igWindows:CardPanel>
							<!-- End Added 8/2/2006 GH -->
							<!-- Header Content -->
							<ContentPresenter
															 x:Name="PART_HeaderContentSite"
															 Grid.Row="0"
															 Grid.Column="1"
															 Content="{TemplateBinding HeaderContent}"
															 Visibility="Visible"
															 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
															 VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>

							<!-- Record Content -->
							<ContentPresenter
														  x:Name="PART_RecordContentSite"
														  Grid.Row="1"
														  Grid.Column="1"
														  Content="{TemplateBinding DataContext}"
														  ContentTemplate="{TemplateBinding RecordContentAreaTemplate}"
														  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
														  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

							<!-- Nested Content -->
							<Border x:Name="PART_NestedContentSite"
															 Grid.Row="2"
															 Grid.Column="1"
															 Visibility="Visible"
															 HorizontalAlignment="Left"
															 VerticalAlignment="Top"
															 Background="{TemplateBinding NestedContentBackground}">
								<!-- AS 11/14/07 BR26035 
								The namescope was broken because the recordlistcontrol was not in the logical tree. We 
								need to use a ContentControl instead so the content	is made a logical child. -->
								<ContentControl
												Content="{TemplateBinding NestedContent}"
												Margin="2,2,0,0" />

							</Border>
						</Grid>
					</igWindows:CardPanel>

					<ControlTemplate.Triggers>

						<Trigger Property="Orientation" Value="Horizontal">
							<Setter TargetName="PART_HeaderContentSite" Property="Grid.Row" Value="1" />
							<Setter TargetName="PART_HeaderContentSite" Property="Grid.Column" Value="0" />
							<Setter TargetName="PART_NestedContentSite" Property="Grid.Row" Value="1" />
							<Setter TargetName="PART_NestedContentSite" Property="Grid.Column" Value="2" />
							<Setter TargetName="PART_RecordContentSite" Property="VerticalAlignment" Value="Top" />
							<Setter TargetName="ExpansionIndicator" Property="Grid.Row" Value="0" />
							<Setter TargetName="ExpansionIndicator" Property="Grid.Column" Value="1" />
							<Setter TargetName="SpacerFill" Property="Grid.ColumnSpan" Value="1" />
							<Setter TargetName="SpacerFill" Property="Grid.RowSpan" Value="3" />
						</Trigger>

						<Trigger Property="ShouldDisplayRecordContent" Value="False">
							<Setter TargetName="PART_RecordContentSite" Property="Visibility" Value="Collapsed" />
						</Trigger>

						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="ShouldDisplayRecordContent" Value="False"/>
								<Condition Property="IsHeaderRecord" Value="False"/>
								<Condition Property="ExpansionIndicatorVisibility" Value="Visible"/>
							</MultiTrigger.Conditions>
							<Setter TargetName="ExpansionIndicator" Property="Visibility" Value="Hidden" />
						</MultiTrigger>

						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="Orientation" Value="Horizontal"/>
								<Condition Property="ShouldDisplayRecordContent" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter TargetName="ExpansionIndicator" Property="Grid.Column" Value="2" />
						</MultiTrigger>

						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="Orientation" Value="Vertical"/>
								<Condition Property="ShouldDisplayRecordContent" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter TargetName="ExpansionIndicator" Property="Grid.Row" Value="2" />
						</MultiTrigger>

						<Trigger Property="IsHeaderRecord" Value="True">
							<Setter TargetName="ExpansionIndicator" Property="Grid.Row" Value="0" />
							<Setter TargetName="ExpansionIndicator" Property="Grid.Column" Value="0" />
						</Trigger>

						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsHeaderRecord" Value="True"/>
								<Condition Property="ExpansionIndicatorVisibility" Value="Visible"/>
							</MultiTrigger.Conditions>
							<Setter TargetName="ExpansionIndicator" Property="Visibility" Value="Hidden" />
						</MultiTrigger>

						<Trigger Property="HasHeaderContent" Value="False">
							<Setter Property="Visibility" TargetName="SpacerFill" Value="Collapsed"/>
							<Setter Property="Visibility" TargetName="PART_HeaderContentSite" Value="Collapsed"/>
						</Trigger>

						<Trigger Property="HasNestedContent" Value="true">
							<Setter TargetName="PART_NestedContentSite" Property="Visibility" Value="Visible" />
							<Setter TargetName="baseGrid" Property="Background" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Background}" />
						</Trigger>

						<Trigger Property="HasNestedContent" Value="False">
							<Setter Property="Visibility" TargetName="PART_NestedContentSite" Value="Collapsed"/>
						</Trigger>

						<Trigger Property="IsFixedOnTop" Value="true">
							<!--Setter Property="Visibility" TargetName="addRowFooter" Value="Visible"/-->
							<Setter Property="Margin" TargetName="PART_RecordContentSite" Value="0,2,0,2"/>
						</Trigger>

						<Trigger Property="IsFixedOnBottom" Value="true">
							<Setter Property="Margin" Value="0,2,0,0" />
							<Setter Property="Margin" TargetName="PART_RecordContentSite" Value="0,2,0,2"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="TemplateCardView">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type igDP:DataRecordPresenter}">

					<StackPanel>
						<uic:VideoThumbnail
                    IsSelected="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Record.IsSelected}"
                    DataRecord="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataRecord}"
                    MediaData="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=DataRecord.DataItem}"/>
						<ContentPresenter
							x:Name="PART_RecordContentSite"
							Visibility="Collapsed"
							Content="{TemplateBinding DataContext}"
							ContentTemplate="{TemplateBinding RecordContentAreaTemplate}"/>
					</StackPanel>

				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>